﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AnimeWatchMax
{
    public static class Extensions
    {
        public static TitleStatusType ToTitleStatus(this string pStatus)
        {
            if (pStatus.Equals("active", StringComparison.CurrentCultureIgnoreCase))
            {
                return TitleStatusType.Active;
            }
            else if (pStatus.Equals("licensed", StringComparison.CurrentCultureIgnoreCase))
            {
                return TitleStatusType.Licensed;
            }
            else if (pStatus.Equals("inactive", StringComparison.CurrentCultureIgnoreCase))
            {
                return TitleStatusType.InActive; //inactive
            }
            else
            {
                return TitleStatusType.None;
            } 
        }

        public static TorrentStatusType ToTorrentStatus(this string pStatus)
        {
            if (pStatus.Equals("active", StringComparison.CurrentCultureIgnoreCase))
            {
                return TorrentStatusType.Active;
            }
            else if (pStatus.Equals("licensed", StringComparison.CurrentCultureIgnoreCase))
            {
                return TorrentStatusType.None;
            }
            else if (pStatus.Equals("inactive", StringComparison.CurrentCultureIgnoreCase))
            {
                return TorrentStatusType.InActive; //inactive
            }
            else
            {
                return TorrentStatusType.None;
            }
        }

        public static EpisodeStatusType ToEpisodeStatus(this string pStatus)
        {
            if (pStatus.Equals("active", StringComparison.CurrentCultureIgnoreCase))
            {
                return EpisodeStatusType.Active;
            }
            else if (pStatus.Equals("licensed", StringComparison.CurrentCultureIgnoreCase))
            {
                return EpisodeStatusType.None;
            }
            else if (pStatus.Equals("inactive", StringComparison.CurrentCultureIgnoreCase))
            {
                return EpisodeStatusType.InActive; //inactive
            }
            else
            {
                return EpisodeStatusType.None;
            }
        }


    }
}
